package presentacion;

import java.awt.EventQueue;

import javax.swing.JFrame;

import java.awt.GridBagLayout;

import javax.swing.JLabel;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JSeparator;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.TitledBorder;
import javax.swing.text.MaskFormatter;
import javax.swing.DefaultComboBoxModel;

import com.toedter.calendar.JDateChooser;

import dominio.ImageFilter;
import dominio.ListenerCerrarVentana;
import dominio.Util;
//import dominio.CamaraWeb;


import javax.swing.JLayeredPane;
import javax.swing.SwingConstants;
import javax.swing.ImageIcon;

import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.File;
import java.text.ParseException;
import java.util.Date;

import javax.swing.JFormattedTextField;

import java.awt.Toolkit;
import java.awt.Cursor;

import javax.swing.JMenuBar;

import java.awt.Component;

import javax.swing.JRadioButtonMenuItem;
import javax.swing.ButtonGroup;

public class AddParticipante {

	JFrame VentanaAnadirParticipante;
	private JLabel lblNombre;
	private JLabel lblPrimerApellido;
	private JLabel lblSegundoApellido;
	private JLabel lblDocumento;
	private JLabel lblCorreoElectronico;
	private JTextField tfNombre;
	private JTextField tfApellido1;
	private JTextField tfApellido2;
	private JComboBox<String> cbDocumento;
	private JTextField tfCorreoElectronico;
	private JPanel DatosPersonales;
	private JLabel lblFechaDeNacimiento;
	private JLabel lblSexo;
	private JComboBox<String> cbSexo;
	private JScrollPane scrollPane;
	private JLabel lblTelefono;
	private JLabel lblNacionalidad;
	private JTextField tfNacionalidad;
	private JPanel Vivienda;
	private JLabel lblCalle;
	private JTextField tfCalle;
	private JLabel lblN;
	private JLabel lblPuerta;
	private JLabel lblPiso;
	private JLabel lblEscalera;
	private JLabel lblLetra;
	private JTextField tfN;
	private JTextField tfPuerta;
	private JTextField tfPiso;
	private JTextField tfEscalera;
	private JTextField tfLetra;
	private JLabel lblLocalidad;
	private JTextField tfLocalidad;
	private JLabel lblCp;
	private JLabel lblProvincia;
	private JPanel DatosCompeticion;
	private JLabel lblTipoDeCorredor;
	private JLabel lblTallaDeCamiseta;
	private JComboBox<String> cbTipoCorredor;
	private JComboBox<String> cbTallaCamiseta;
	private JLabel lblClubDeportivo;
	private JScrollPane spSponsor;
	private JTextField tfClubDeportivo;
	private JLabel lblSponsor;
	private JDateChooser fechaNacim;
	private JPanel layeredPane;
	private JLabel lblOpcion;
	private JButton btnCargar;
	private JButton btnWebCam;
	private JLabel lblFoto;
	private JFormattedTextField ftfDocumento;
	private JMenuBar menuBar;
	private JMenu mnArchivo;
	private JMenu mnGestion;
	private JMenu mnAyuda;
	private JMenuItem mntmAcercaDe;
	private JMenuItem mntmAyuda;
	private JMenuItem mntmSalir;
	private JSeparator separator;
	private JMenu mnCambiarIdioma;
	private JRadioButtonMenuItem mntmEspaol;
	private JRadioButtonMenuItem mntmIngls;
	private JComboBox<String> cbProvincia;
	private JFormattedTextField ftfTelefono;
	private JFormattedTextField ftfCP;
	private JLabel lblSponsorIco;
	private JButton btnGuardar;
	private JButton btnCancelar;
	private JMenuItem mntmGuardar;
	private JMenuItem mntmCancelar;
	private JMenuItem mntmCargarFoto;
	private JMenuItem mntmHacerFoto;
	private final ButtonGroup buttonGroup = new ButtonGroup();
	private JFrame ventanaInvocadora;
	private JButton btnAyuda;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AddParticipante window = new AddParticipante(null);
					window.VentanaAnadirParticipante.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 * 
	 * @throws UnsupportedLookAndFeelException
	 */
	public AddParticipante(JFrame ventana)
			 {
		ventanaInvocadora = ventana;
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 * 
	 * @throws UnsupportedLookAndFeelException
	 */
	private void initialize() {
		VentanaAnadirParticipante = new JFrame();
		VentanaAnadirParticipante.addWindowListener(new ListenerCerrarVentana(
				VentanaAnadirParticipante));
		VentanaAnadirParticipante
				.setIconImage(Toolkit.getDefaultToolkit()
						.getImage(
								AddParticipante.class
										.getResource("/recursos/LOGO.png"))); //$NON-NLS-1$
		VentanaAnadirParticipante.setTitle(Messages
				.getString("AddParticipante.1")); //$NON-NLS-1$
		VentanaAnadirParticipante.setBounds(100, 100, 625, 670);
		VentanaAnadirParticipante
				.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		VentanaAnadirParticipante.getContentPane().setLayout(null);
		VentanaAnadirParticipante.setLocationRelativeTo(null);
		{
			DatosPersonales = new JPanel();
			DatosPersonales.setBounds(0, 0, 603, 305);
			DatosPersonales
					.setBorder(new TitledBorder(
							null,
							Messages.getString("AddParticipante.2"), TitledBorder.LEADING, TitledBorder.TOP, //$NON-NLS-1$
							null, null));
			DatosPersonales.setLayout(null);
			VentanaAnadirParticipante.getContentPane().add(DatosPersonales);
			{
				lblNombre = new JLabel(Messages.getString("AddParticipante.3")); //$NON-NLS-1$
				lblNombre.setBounds(76, 29, 76, 14);
				DatosPersonales.add(lblNombre);
			}
			{
				tfNombre = new JTextField();
				tfNombre.setBounds(76, 48, 195, 20);
				tfNombre.addFocusListener(new MiFocusListener());
				DatosPersonales.add(tfNombre);
				tfNombre.setColumns(10);
			}
			{
				scrollPane = new JScrollPane();
				scrollPane.setBorder(null);
				scrollPane.setBounds(334, 29, 183, 175);
				scrollPane.setEnabled(false);
				scrollPane.setViewportBorder(null);
				DatosPersonales.add(scrollPane);
				{
					layeredPane = new JPanel();
					layeredPane
							.setBorder(new TitledBorder(
									null,
									Messages.getString("AddParticipante.4"), TitledBorder.LEADING, //$NON-NLS-1$
									TitledBorder.TOP, null, null));
					scrollPane.setViewportView(layeredPane);
					layeredPane.setLayout(null);
					{
						{
							btnCargar = new JButton(
									Messages.getString("AddParticipante.9")); //$NON-NLS-1$
							btnCargar.setBounds(10, 59, 161, 45);
							layeredPane.add(btnCargar);
							btnCargar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
							btnCargar.setToolTipText(Messages
									.getString("AddParticipante.10"));
							btnCargar
									.addActionListener(new CargarActionListener());
							btnCargar
									.setIcon(new ImageIcon(
											AddParticipante.class
													.getResource("/recursos/36x36.png")));
						}
						{
							btnWebCam = new JButton(
									Messages.getString("AddParticipante.12")); //$NON-NLS-1$
							btnWebCam.setBounds(10, 117, 161, 45);
							layeredPane.add(btnWebCam);
							btnWebCam.setToolTipText(Messages
									.getString("AddParticipante.13")); //$NON-NLS-1$
							btnWebCam.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
							btnWebCam
									.setIcon(new ImageIcon(
											AddParticipante.class
													.getResource("/recursos/Webcam36x36.png"))); //$NON-NLS-1$
							btnWebCam.addActionListener(new WebCamActionListener());
						}
						{
							lblFoto = new JLabel(""); //$NON-NLS-1$
							lblFoto.setBounds(289, 45, 0, 0);
							layeredPane.add(lblFoto);
							lblFoto.setBorder(null);
							lblFoto.setHorizontalAlignment(SwingConstants.CENTER);
						}
						{
							lblOpcion = new JLabel(
									Messages.getString("AddParticipante.7"));
							lblOpcion.setHorizontalAlignment(SwingConstants.CENTER);
							lblOpcion.setBounds(0, 31, 183, 14);
							layeredPane.add(lblOpcion);
							lblOpcion
									.setFont(new Font("Tahoma", Font.PLAIN, 12));
						}
					}
				}
			}
			{
				lblPrimerApellido = new JLabel(
						Messages.getString("AddParticipante.15")); //$NON-NLS-1$
				lblPrimerApellido.setBounds(76, 73, 145, 14);
				DatosPersonales.add(lblPrimerApellido);
			}
			{
				tfApellido1 = new JTextField();
				tfApellido1.setBounds(76, 92, 195, 20);
				tfApellido1.addFocusListener(new MiFocusListener());
				DatosPersonales.add(tfApellido1);
				tfApellido1.setColumns(10);
			}
			{
				lblSegundoApellido = new JLabel(
						Messages.getString("AddParticipante.16")); //$NON-NLS-1$
				lblSegundoApellido.setBounds(76, 117, 145, 14);
				DatosPersonales.add(lblSegundoApellido);
			}
			{
				tfApellido2 = new JTextField();
				tfApellido2.setBounds(76, 136, 195, 20);
				tfApellido2.addFocusListener(new MiFocusListener());
				DatosPersonales.add(tfApellido2);
				tfApellido2.setColumns(10);
			}
			{
				lblDocumento = new JLabel(
						Messages.getString("AddParticipante.17")); //$NON-NLS-1$
				lblDocumento.setBounds(76, 161, 145, 20);
				DatosPersonales.add(lblDocumento);
			}
			{
				cbDocumento = new JComboBox<String>();
				cbDocumento.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				cbDocumento.setBounds(76, 182, 63, 20);
				cbDocumento
						.setModel(new DefaultComboBoxModel<String>(
								new String[] {
										Messages.getString("AddParticipante.18"), Messages.getString("AddParticipante.19") })); //$NON-NLS-1$ //$NON-NLS-2$
				DatosPersonales.add(cbDocumento);
			}
			{
				lblCorreoElectronico = new JLabel(
						Messages.getString("AddParticipante.20")); //$NON-NLS-1$
				lblCorreoElectronico.setBounds(76, 209, 145, 14);
				DatosPersonales.add(lblCorreoElectronico);
			}
			{
				tfCorreoElectronico = new JTextField();
				tfCorreoElectronico.setBounds(76, 228, 276, 20);
				tfCorreoElectronico.addFocusListener(new MiFocusListener());
				{
					lblFechaDeNacimiento = new JLabel(
							Messages.getString("AddParticipante.21")); //$NON-NLS-1$
					lblFechaDeNacimiento.setBounds(384, 209, 133, 14);
					DatosPersonales.add(lblFechaDeNacimiento);
				}
				DatosPersonales.add(tfCorreoElectronico);
				tfCorreoElectronico.setColumns(10);
			}
			{
				fechaNacim = new JDateChooser();
				fechaNacim.getCalendarButton().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				fechaNacim.setBounds(384, 228, 133, 20);
				fechaNacim.setDateFormatString("dd/MM/yyyy"); //$NON-NLS-1$
				fechaNacim.addFocusListener(new MiFocusListener());
				DatosPersonales.add(fechaNacim);
			}
			{
				lblTelefono = new JLabel(
						Messages.getString("AddParticipante.23")); //$NON-NLS-1$
				lblTelefono.setBounds(76, 253, 129, 14);
				DatosPersonales.add(lblTelefono);
			}
			{
				lblNacionalidad = new JLabel(
						Messages.getString("AddParticipante.24")); //$NON-NLS-1$
				lblNacionalidad.setBounds(217, 253, 135, 20);
				DatosPersonales.add(lblNacionalidad);
			}
			{
				{
					lblSexo = new JLabel(
							Messages.getString("AddParticipante.25")); //$NON-NLS-1$
					lblSexo.setBounds(384, 253, 65, 14);
					DatosPersonales.add(lblSexo);
				}
			}
			{
				tfNacionalidad = new JTextField();
				tfNacionalidad.setBounds(217, 272, 135, 20);
				tfNacionalidad.addFocusListener(new MiFocusListener());
				DatosPersonales.add(tfNacionalidad);
				tfNacionalidad.setColumns(10);
			}
			{
				cbSexo = new JComboBox<String>();
				cbSexo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				cbSexo.setBounds(384, 272, 133, 20);
				cbSexo.setModel(new DefaultComboBoxModel<String>(
						new String[] {
								Messages.getString("AddParticipante.26"), Messages.getString("AddParticipante.27") })); //$NON-NLS-1$ //$NON-NLS-2$
				DatosPersonales.add(cbSexo);
			}
			{
				MaskFormatter formatoDNI;
				try {
					formatoDNI = new MaskFormatter("########'-U"); //$NON-NLS-1$
					formatoDNI.setPlaceholderCharacter('X');
					ftfDocumento = new JFormattedTextField(formatoDNI);
				} catch (ParseException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				ftfDocumento.setBounds(149, 182, 122, 20);
				DatosPersonales.add(ftfDocumento);
			}
			{
				MaskFormatter formatoTlfno;
				try {
					formatoTlfno = new MaskFormatter("'(###')' ###' ###' ###"); //$NON-NLS-1$
					formatoTlfno.setPlaceholderCharacter('*');
					ftfTelefono = new JFormattedTextField(formatoTlfno);
				} catch (ParseException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				ftfTelefono.addFocusListener(new MiFocusListener());
				ftfTelefono.setBounds(76, 268, 102, 20);
				DatosPersonales.add(ftfTelefono);
			}
			{
				btnAyuda = new JButton("");
				btnAyuda.setMnemonic('H');
				btnAyuda.setBounds(572, 0, 31, 25);
				btnAyuda.addActionListener(new AyudaActionListener());
				DatosPersonales.add(btnAyuda);
				btnAyuda.setIcon(new ImageIcon(AddParticipante.class.getResource("/recursos/help.png")));
				btnAyuda.setToolTipText("¿Necesita ayuda?");
			}
		}
		{
			Vivienda = new JPanel();
			Vivienda.setBounds(0, 309, 294, 262);
			Vivienda.setBorder(new TitledBorder(null, Messages
					.getString("AddParticipante.30"), //$NON-NLS-1$
					TitledBorder.LEADING, TitledBorder.TOP, null, null));
			VentanaAnadirParticipante.getContentPane().add(Vivienda);
			{
				GridBagLayout gbl_Vivienda = new GridBagLayout();
				gbl_Vivienda.columnWidths = new int[] { 20, 30, 36, 24, 31, 29,
						0 };
				gbl_Vivienda.rowHeights = new int[] { 14, 20, 14, 20, 14, 20,
						14, 20, 0 };
				gbl_Vivienda.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0,
						0.0, 0.0, Double.MIN_VALUE };
				gbl_Vivienda.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0,
						0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE };
				Vivienda.setLayout(gbl_Vivienda);
				{
					lblCalle = new JLabel(
							Messages.getString("AddParticipante.31")); //$NON-NLS-1$
					GridBagConstraints gbc_lblCalle = new GridBagConstraints();
					gbc_lblCalle.gridwidth = 2;
					gbc_lblCalle.anchor = GridBagConstraints.NORTHWEST;
					gbc_lblCalle.insets = new Insets(0, 0, 5, 5);
					gbc_lblCalle.gridx = 1;
					gbc_lblCalle.gridy = 0;
					Vivienda.add(lblCalle, gbc_lblCalle);
				}
				tfCalle = new JTextField();
				tfCalle.addFocusListener(new MiFocusListener());
				GridBagConstraints gbc_tfCalle = new GridBagConstraints();
				gbc_tfCalle.anchor = GridBagConstraints.NORTH;
				gbc_tfCalle.fill = GridBagConstraints.HORIZONTAL;
				gbc_tfCalle.insets = new Insets(0, 0, 5, 0);
				gbc_tfCalle.gridwidth = 5;
				gbc_tfCalle.gridx = 1;
				gbc_tfCalle.gridy = 1;
				Vivienda.add(tfCalle, gbc_tfCalle);
				tfCalle.setColumns(10);
				{
					lblN = new JLabel(Messages.getString("AddParticipante.32")); //$NON-NLS-1$
					GridBagConstraints gbc_lblN = new GridBagConstraints();
					gbc_lblN.anchor = GridBagConstraints.NORTHWEST;
					gbc_lblN.insets = new Insets(0, 0, 5, 5);
					gbc_lblN.gridx = 1;
					gbc_lblN.gridy = 2;
					Vivienda.add(lblN, gbc_lblN);
				}
				{
					lblPuerta = new JLabel(
							Messages.getString("AddParticipante.33")); //$NON-NLS-1$
					GridBagConstraints gbc_lblPuerta = new GridBagConstraints();
					gbc_lblPuerta.anchor = GridBagConstraints.NORTHWEST;
					gbc_lblPuerta.insets = new Insets(0, 0, 5, 5);
					gbc_lblPuerta.gridx = 2;
					gbc_lblPuerta.gridy = 2;
					Vivienda.add(lblPuerta, gbc_lblPuerta);
				}
				{
					lblPiso = new JLabel(
							Messages.getString("AddParticipante.34")); //$NON-NLS-1$
					GridBagConstraints gbc_lblPiso = new GridBagConstraints();
					gbc_lblPiso.anchor = GridBagConstraints.NORTHWEST;
					gbc_lblPiso.insets = new Insets(0, 0, 5, 5);
					gbc_lblPiso.gridx = 3;
					gbc_lblPiso.gridy = 2;
					Vivienda.add(lblPiso, gbc_lblPiso);
				}
				{
					lblEscalera = new JLabel(
							Messages.getString("AddParticipante.35")); //$NON-NLS-1$
					GridBagConstraints gbc_lblEscalera = new GridBagConstraints();
					gbc_lblEscalera.anchor = GridBagConstraints.NORTHWEST;
					gbc_lblEscalera.insets = new Insets(0, 0, 5, 5);
					gbc_lblEscalera.gridx = 4;
					gbc_lblEscalera.gridy = 2;
					Vivienda.add(lblEscalera, gbc_lblEscalera);
				}
				tfN = new JTextField();
				tfN.addFocusListener(new MiFocusListener());
				{
					lblLetra = new JLabel(
							Messages.getString("AddParticipante.36")); //$NON-NLS-1$
					GridBagConstraints gbc_lblLetra = new GridBagConstraints();
					gbc_lblLetra.anchor = GridBagConstraints.NORTHWEST;
					gbc_lblLetra.insets = new Insets(0, 0, 5, 0);
					gbc_lblLetra.gridx = 5;
					gbc_lblLetra.gridy = 2;
					Vivienda.add(lblLetra, gbc_lblLetra);
				}
				GridBagConstraints gbc_tfN = new GridBagConstraints();
				gbc_tfN.anchor = GridBagConstraints.NORTH;
				gbc_tfN.fill = GridBagConstraints.HORIZONTAL;
				gbc_tfN.insets = new Insets(0, 0, 5, 5);
				gbc_tfN.gridx = 1;
				gbc_tfN.gridy = 3;
				Vivienda.add(tfN, gbc_tfN);
				tfN.setColumns(10);
				{
					tfPuerta = new JTextField();
					tfPuerta.addFocusListener(new MiFocusListener());
					GridBagConstraints gbc_tfPuerta = new GridBagConstraints();
					gbc_tfPuerta.anchor = GridBagConstraints.NORTH;
					gbc_tfPuerta.fill = GridBagConstraints.HORIZONTAL;
					gbc_tfPuerta.insets = new Insets(0, 0, 5, 5);
					gbc_tfPuerta.gridx = 2;
					gbc_tfPuerta.gridy = 3;
					Vivienda.add(tfPuerta, gbc_tfPuerta);
					tfPuerta.setColumns(10);
				}
				{
					tfPiso = new JTextField();
					tfPiso.addFocusListener(new MiFocusListener());
					GridBagConstraints gbc_tfPiso = new GridBagConstraints();
					gbc_tfPiso.anchor = GridBagConstraints.NORTH;
					gbc_tfPiso.fill = GridBagConstraints.HORIZONTAL;
					gbc_tfPiso.insets = new Insets(0, 0, 5, 5);
					gbc_tfPiso.gridx = 3;
					gbc_tfPiso.gridy = 3;
					Vivienda.add(tfPiso, gbc_tfPiso);
					tfPiso.setColumns(10);
				}
				tfLetra = new JTextField();
				tfLetra.addFocusListener(new MiFocusListener());
				{
					tfEscalera = new JTextField();
					tfEscalera.addFocusListener(new MiFocusListener());
					GridBagConstraints gbc_tfEscalera = new GridBagConstraints();
					gbc_tfEscalera.anchor = GridBagConstraints.NORTH;
					gbc_tfEscalera.fill = GridBagConstraints.HORIZONTAL;
					gbc_tfEscalera.insets = new Insets(0, 0, 5, 5);
					gbc_tfEscalera.gridx = 4;
					gbc_tfEscalera.gridy = 3;
					Vivienda.add(tfEscalera, gbc_tfEscalera);
					tfEscalera.setColumns(10);
				}
				GridBagConstraints gbc_tfLetra = new GridBagConstraints();
				gbc_tfLetra.anchor = GridBagConstraints.NORTH;
				gbc_tfLetra.fill = GridBagConstraints.HORIZONTAL;
				gbc_tfLetra.insets = new Insets(0, 0, 5, 0);
				gbc_tfLetra.gridx = 5;
				gbc_tfLetra.gridy = 3;
				Vivienda.add(tfLetra, gbc_tfLetra);
				tfLetra.setColumns(10);
				{
					lblLocalidad = new JLabel(
							Messages.getString("AddParticipante.37")); //$NON-NLS-1$
					GridBagConstraints gbc_lblLocalidad = new GridBagConstraints();
					gbc_lblLocalidad.anchor = GridBagConstraints.NORTH;
					gbc_lblLocalidad.fill = GridBagConstraints.HORIZONTAL;
					gbc_lblLocalidad.insets = new Insets(0, 0, 5, 5);
					gbc_lblLocalidad.gridwidth = 2;
					gbc_lblLocalidad.gridx = 1;
					gbc_lblLocalidad.gridy = 4;
					Vivienda.add(lblLocalidad, gbc_lblLocalidad);
				}
				{
					tfLocalidad = new JTextField();
					tfLocalidad.addFocusListener(new MiFocusListener());
					{
						lblCp = new JLabel(
								Messages.getString("AddParticipante.38")); //$NON-NLS-1$
						GridBagConstraints gbc_lblCp = new GridBagConstraints();
						gbc_lblCp.anchor = GridBagConstraints.NORTH;
						gbc_lblCp.insets = new Insets(0, 0, 5, 5);
						gbc_lblCp.gridx = 4;
						gbc_lblCp.gridy = 4;
						Vivienda.add(lblCp, gbc_lblCp);
					}
					GridBagConstraints gbc_tfLocalidad = new GridBagConstraints();
					gbc_tfLocalidad.anchor = GridBagConstraints.NORTH;
					gbc_tfLocalidad.fill = GridBagConstraints.HORIZONTAL;
					gbc_tfLocalidad.insets = new Insets(0, 0, 5, 5);
					gbc_tfLocalidad.gridwidth = 3;
					gbc_tfLocalidad.gridx = 1;
					gbc_tfLocalidad.gridy = 5;
					Vivienda.add(tfLocalidad, gbc_tfLocalidad);
					tfLocalidad.setColumns(10);
				}
				{
					MaskFormatter formatoCP;
					try {
						formatoCP = new MaskFormatter("#####"); //$NON-NLS-1$
						formatoCP.setPlaceholderCharacter('*');
						ftfCP = new JFormattedTextField(formatoCP);
					} catch (ParseException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
					ftfCP.addFocusListener(new MiFocusListener());
					GridBagConstraints gbc_ftfCP = new GridBagConstraints();
					gbc_ftfCP.gridwidth = 2;
					gbc_ftfCP.insets = new Insets(0, 0, 5, 5);
					gbc_ftfCP.fill = GridBagConstraints.HORIZONTAL;
					gbc_ftfCP.gridx = 4;
					gbc_ftfCP.gridy = 5;
					Vivienda.add(ftfCP, gbc_ftfCP);
				}
				{
					{
						lblProvincia = new JLabel(
								Messages.getString("AddParticipante.40")); //$NON-NLS-1$
						GridBagConstraints gbc_lblProvincia = new GridBagConstraints();
						gbc_lblProvincia.anchor = GridBagConstraints.NORTHWEST;
						gbc_lblProvincia.insets = new Insets(0, 0, 5, 5);
						gbc_lblProvincia.gridwidth = 2;
						gbc_lblProvincia.gridx = 1;
						gbc_lblProvincia.gridy = 6;
						Vivienda.add(lblProvincia, gbc_lblProvincia);
					}
				}
			}
			{
				cbProvincia = new JComboBox<String>();
				cbProvincia.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				cbProvincia.setModel(new DefaultComboBoxModel<String>(
						new String[] { "Álava", "Albacete", "Alicante", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
								"Almería", "Ávila", "Badajoz", "Baleares", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Barcelona", "Burgos", "Cáceres", "Cádiz", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Castellon", "Ciudad Real", "Córdoba", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
								"La Coruña", "Cuenca", "Gerona", "Granada", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Guadalajara", "Guipúzcoa", "Huelva", "Huesca", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Jaén", "León", "Lérida", "Logroño", "Lugo", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
								"Madrid", "Málaga", "Murcia", "Navarra", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Orense", "Asturias", "Palencia", "Las Palmas", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Pontevedra", "Salamanca", "Tenerife", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
								"Cantabria", "Segovia", "Sevilla", "Soria", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Tarragona", "Teruel", "Toledo", "Valencia", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Valladolid", "Vizcaya", "Zamora", "Zaragoza", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
								"Ceuta", "Melilla", "\t" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
				GridBagConstraints gbc_cbProvincia = new GridBagConstraints();
				gbc_cbProvincia.gridwidth = 4;
				gbc_cbProvincia.insets = new Insets(0, 0, 0, 5);
				gbc_cbProvincia.fill = GridBagConstraints.HORIZONTAL;
				gbc_cbProvincia.gridx = 1;
				gbc_cbProvincia.gridy = 7;
				Vivienda.add(cbProvincia, gbc_cbProvincia);
			}
		}
		{
			menuBar = new JMenuBar();
			VentanaAnadirParticipante.setJMenuBar(menuBar);
			{
				mnArchivo = new JMenu(Messages.getString("AddParticipante.94")); //$NON-NLS-1$
				mnArchivo.setMnemonic('1');
				mnArchivo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				menuBar.add(mnArchivo);
				{
					mntmGuardar = new JMenuItem(
							Messages.getString("AddParticipante.95")); //$NON-NLS-1$
					mntmGuardar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmGuardar.addActionListener(new GuardarActionListener());
					mntmGuardar.setIcon(new ImageIcon(AddParticipante.class
							.getResource("/recursos/Guardar-32.png"))); //$NON-NLS-1$
					mnArchivo.add(mntmGuardar);
				}
				{
					mntmCancelar = new JMenuItem(
							Messages.getString("AddParticipante.97")); //$NON-NLS-1$
					mntmCancelar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmCancelar
							.addActionListener(new CancelarActionListener());
					mntmCancelar.setIcon(new ImageIcon(AddParticipante.class
							.getResource("/recursos/delete_64.png"))); //$NON-NLS-1$
					mnArchivo.add(mntmCancelar);
				}
				{
					separator = new JSeparator();
					mnArchivo.add(separator);
				}
				{
					mnCambiarIdioma = new JMenu(
							Messages.getString("AddParticipante.99")); //$NON-NLS-1$
					mnCambiarIdioma.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mnCambiarIdioma.setToolTipText(Messages
							.getString("AddParticipante.100")); //$NON-NLS-1$
					mnCambiarIdioma.setIcon(new ImageIcon(Menu.class
							.getResource("/recursos/select_language_32.png"))); //$NON-NLS-1$
					mnArchivo.add(mnCambiarIdioma);
					{
						mntmEspaol = new JRadioButtonMenuItem(
								Messages.getString("AddParticipante.102")); //$NON-NLS-1$
						mntmEspaol.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
						mntmEspaol.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {
								Util.internacionalizarMensajes("castellano");
								Messages.setIdioma("castellano"); //$NON-NLS-1$
								AddParticipante ventana = null;
								
									ventana = new AddParticipante(
											ventanaInvocadora);
								
								ventana.VentanaAnadirParticipante
										.setVisible(true);
								VentanaAnadirParticipante.setVisible(false);
								ventana.mntmEspaol.setSelected(true);
								ventana.mntmIngls.setSelected(false);
								if(VentanaAnadirParticipante.getTitle().equals("Modify inscribed")){
									ventana.modificar(tfNombre.getText()+" "+tfApellido1.getText()+" "+tfApellido2.getText());
									ventana.VentanaAnadirParticipante.setTitle("Modificar participante");
								}
							}

						});
						buttonGroup.add(mntmEspaol);
						mntmEspaol.setToolTipText(Messages
								.getString("AddParticipante.103")); //$NON-NLS-1$
						mntmEspaol.setIcon(new ImageIcon(Menu.class
								.getResource("/recursos/banderaEsp.gif"))); //$NON-NLS-1$
						mnCambiarIdioma.add(mntmEspaol);
					}
					{
						mntmIngls = new JRadioButtonMenuItem(
								Messages.getString("AddParticipante.105")); //$NON-NLS-1$
						mntmIngls.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
						mntmIngls.addActionListener(new ActionListener() {
							public void actionPerformed(ActionEvent e) {	
								Util.internacionalizarMensajes("Inglés");
								Messages.setIdioma("inglés"); //$NON-NLS-1$
								AddParticipante ventana = null;
								
									ventana = new AddParticipante(
											ventanaInvocadora);
								
								ventana.VentanaAnadirParticipante
										.setVisible(true);
								VentanaAnadirParticipante.setVisible(false);
								ventana.mntmEspaol.setSelected(false);
								ventana.mntmIngls.setSelected(true);
								if(VentanaAnadirParticipante.getTitle().equals("Modificar participante")){
									ventana.modificar(tfNombre.getText()+" "+tfApellido1.getText()+" "+tfApellido2.getText());
									ventana.VentanaAnadirParticipante.setTitle("Modify inscribed");
								}
							}
						});
						buttonGroup.add(mntmIngls);
						mntmEspaol.setSelected(true);
						mntmIngls.setToolTipText("Change to English"); //$NON-NLS-1$
						mntmIngls.setIcon(new ImageIcon(Menu.class
								.getResource("/recursos/banderaIng.gif"))); //$NON-NLS-1$
						mnCambiarIdioma.add(mntmIngls);
					}
				}
				{
					JSeparator separator_1 = new JSeparator();
					mnArchivo.add(separator_1);
				}
				{
					mntmSalir = new JMenuItem(
							Messages.getString("AddParticipante.108")); //$NON-NLS-1$
					mntmSalir.setMnemonic('E');
					mntmSalir.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmSalir.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							if (JOptionPane
									.showConfirmDialog(
											VentanaAnadirParticipante,
											"¿Esta seguro que desea salir? Los cambios no guardados se perderán.",
											"ATENCION!",
											JOptionPane.OK_CANCEL_OPTION) == JOptionPane.YES_OPTION) {
								System.exit(0);
							}
						}
					});
					mntmSalir.setToolTipText(Messages
							.getString("AddParticipante.111")); //$NON-NLS-1$
					mntmSalir.setIcon(new ImageIcon(Menu.class
							.getResource("/recursos/login_out_32.png"))); //$NON-NLS-1$
					mnArchivo.add(mntmSalir);
				}
			}
			{
				mnGestion = new JMenu(Messages.getString("AddParticipante.113")); //$NON-NLS-1$
				mnGestion.setMnemonic('2');
				mnGestion.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				menuBar.add(mnGestion);
				{
					mntmCargarFoto = new JMenuItem(
							Messages.getString("AddParticipante.114")); //$NON-NLS-1$
					mntmCargarFoto.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmCargarFoto
							.addActionListener(new CargarActionListener());
					mntmCargarFoto.setIcon(new ImageIcon(AddParticipante.class
							.getResource("/recursos/36x36.png"))); //$NON-NLS-1$
					mnGestion.add(mntmCargarFoto);
				}
				{
					mntmHacerFoto = new JMenuItem(
							Messages.getString("AddParticipante.116")); //$NON-NLS-1$
					mntmHacerFoto.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmHacerFoto.setIcon(new ImageIcon(AddParticipante.class
							.getResource("/recursos/Webcam36x36.png"))); //$NON-NLS-1$
					mnGestion.add(mntmHacerFoto);
				}

			}
			{
				mnAyuda = new JMenu(Messages.getString("AddParticipante.118")); //$NON-NLS-1$
				mnAyuda.setMnemonic('3');
				mnAyuda.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				menuBar.add(mnAyuda);
				{
					mntmAyuda = new JMenuItem(
							Messages.getString("AddParticipante.119")); //$NON-NLS-1$
					mntmAyuda.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmAyuda.addActionListener(new AyudaActionListener());

					mntmAyuda.setIcon(new ImageIcon(Menu.class
							.getResource("/recursos/Ayuda.png"))); //$NON-NLS-1$
					mnAyuda.add(mntmAyuda);
				}

				{
					mntmAcercaDe = new JMenuItem(
							Messages.getString("AddParticipante.121")); //$NON-NLS-1$
					mntmAcercaDe.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
					mntmAcercaDe.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent e) {
							AcercaDe app = null;
							app = new AcercaDe(VentanaAnadirParticipante);
							app.VentanaAcercaDe.setVisible(true);
							VentanaAnadirParticipante.enable(false);
						}
					});
					mntmAcercaDe.setIcon(new ImageIcon(Menu.class
							.getResource("/recursos/LOGO-pqeq.png"))); //$NON-NLS-1$
					mnAyuda.add(mntmAcercaDe);
				}
			}
		}
		{
			DatosCompeticion = new JPanel();
			DatosCompeticion.setBounds(294, 309, 309, 192);
			DatosCompeticion.setBorder(new TitledBorder(null, Messages
					.getString("AddParticipante.123"), TitledBorder.LEADING, //$NON-NLS-1$
					TitledBorder.TOP, null, null));
			VentanaAnadirParticipante.getContentPane().add(DatosCompeticion);
			GridBagLayout gbl_DatosCompeticion = new GridBagLayout();
			gbl_DatosCompeticion.columnWidths = new int[] { 98, 54, 93, 0 };
			gbl_DatosCompeticion.rowHeights = new int[] { 44, 37, 19, 0, 0, 0 };
			gbl_DatosCompeticion.columnWeights = new double[] { 0.0, 0.0, 0.0,
					Double.MIN_VALUE };
			gbl_DatosCompeticion.rowWeights = new double[] { 0.0, 0.0, 0.0,
					0.0, 0.0, Double.MIN_VALUE };
			DatosCompeticion.setLayout(gbl_DatosCompeticion);
			{
				lblTipoDeCorredor = new JLabel(
						Messages.getString("AddParticipante.124")); //$NON-NLS-1$
				GridBagConstraints gbc_lblTipoDeCorredor = new GridBagConstraints();
				gbc_lblTipoDeCorredor.insets = new Insets(0, 0, 5, 5);
				gbc_lblTipoDeCorredor.gridx = 0;
				gbc_lblTipoDeCorredor.gridy = 0;
				DatosCompeticion.add(lblTipoDeCorredor, gbc_lblTipoDeCorredor);
			}
			{
				cbTipoCorredor = new JComboBox<String>();
				cbTipoCorredor.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				cbTipoCorredor
						.setModel(new DefaultComboBoxModel<String>(
								new String[] {
										Messages.getString("AddParticipante.125"), Messages.getString("AddParticipante.126"), Messages.getString("AddParticipante.127") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
				GridBagConstraints gbc_cbTipoCorredor = new GridBagConstraints();
				gbc_cbTipoCorredor.insets = new Insets(0, 0, 5, 5);
				gbc_cbTipoCorredor.fill = GridBagConstraints.HORIZONTAL;
				gbc_cbTipoCorredor.gridx = 1;
				gbc_cbTipoCorredor.gridy = 0;
				DatosCompeticion.add(cbTipoCorredor, gbc_cbTipoCorredor);
			}
			{
				spSponsor = new JScrollPane();
				GridBagConstraints gbc_spSponsor = new GridBagConstraints();
				gbc_spSponsor.gridheight = 2;
				gbc_spSponsor.insets = new Insets(0, 0, 5, 0);
				gbc_spSponsor.fill = GridBagConstraints.BOTH;
				gbc_spSponsor.gridx = 2;
				gbc_spSponsor.gridy = 0;
				DatosCompeticion.add(spSponsor, gbc_spSponsor);
				{
					lblSponsorIco = new JLabel(""); //$NON-NLS-1$
					lblSponsorIco.setIcon(new ImageIcon(AddParticipante.class.getResource("/recursos/Adidas.png")));
					lblSponsorIco.setHorizontalAlignment(SwingConstants.CENTER);
					spSponsor.setViewportView(lblSponsorIco);
				}
			}
			{
				lblTallaDeCamiseta = new JLabel(
						Messages.getString("AddParticipante.129")); //$NON-NLS-1$
				GridBagConstraints gbc_lblTallaDeCamiseta = new GridBagConstraints();
				gbc_lblTallaDeCamiseta.insets = new Insets(0, 0, 5, 5);
				gbc_lblTallaDeCamiseta.gridx = 0;
				gbc_lblTallaDeCamiseta.gridy = 1;
				DatosCompeticion
						.add(lblTallaDeCamiseta, gbc_lblTallaDeCamiseta);
			}
			{
				cbTallaCamiseta = new JComboBox<String>();
				cbTallaCamiseta.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
				cbTallaCamiseta
						.setModel(new DefaultComboBoxModel<String>(
								new String[] {
										Messages.getString("AddParticipante.130"), Messages.getString("AddParticipante.131"), Messages.getString("AddParticipante.132"), Messages.getString("AddParticipante.133"), Messages.getString("AddParticipante.134") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
				GridBagConstraints gbc_cbTallaCamiseta = new GridBagConstraints();
				gbc_cbTallaCamiseta.insets = new Insets(0, 0, 5, 5);
				gbc_cbTallaCamiseta.fill = GridBagConstraints.HORIZONTAL;
				gbc_cbTallaCamiseta.gridx = 1;
				gbc_cbTallaCamiseta.gridy = 1;
				DatosCompeticion.add(cbTallaCamiseta, gbc_cbTallaCamiseta);
			}
			{
				lblSponsor = new JLabel(
						Messages.getString("AddParticipante.135")); //$NON-NLS-1$
				GridBagConstraints gbc_lblSponsor = new GridBagConstraints();
				gbc_lblSponsor.anchor = GridBagConstraints.NORTH;
				gbc_lblSponsor.insets = new Insets(0, 0, 5, 0);
				gbc_lblSponsor.gridx = 2;
				gbc_lblSponsor.gridy = 2;
				DatosCompeticion.add(lblSponsor, gbc_lblSponsor);
			}
			{
				lblClubDeportivo = new JLabel(
						Messages.getString("AddParticipante.136")); //$NON-NLS-1$
				GridBagConstraints gbc_lblClubDeportivo = new GridBagConstraints();
				gbc_lblClubDeportivo.gridwidth = 2;
				gbc_lblClubDeportivo.anchor = GridBagConstraints.WEST;
				gbc_lblClubDeportivo.insets = new Insets(0, 0, 5, 5);
				gbc_lblClubDeportivo.gridx = 0;
				gbc_lblClubDeportivo.gridy = 3;
				DatosCompeticion.add(lblClubDeportivo, gbc_lblClubDeportivo);
			}
			{
				tfClubDeportivo = new JTextField();
				tfClubDeportivo.addFocusListener(new MiFocusListener());
				GridBagConstraints gbc_tfClubDeportivo = new GridBagConstraints();
				gbc_tfClubDeportivo.fill = GridBagConstraints.HORIZONTAL;
				gbc_tfClubDeportivo.gridwidth = 2;
				gbc_tfClubDeportivo.insets = new Insets(0, 0, 0, 5);
				gbc_tfClubDeportivo.gridx = 0;
				gbc_tfClubDeportivo.gridy = 4;
				DatosCompeticion.add(tfClubDeportivo, gbc_tfClubDeportivo);
				tfClubDeportivo.setColumns(10);
			}
		}
		{
			btnGuardar = new JButton(Messages.getString("AddParticipante.137")); //$NON-NLS-1$
			btnGuardar.setMnemonic('S');
			btnGuardar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
			btnGuardar.setBounds(329, 540, 120, 40);
			VentanaAnadirParticipante.getContentPane().add(btnGuardar);
			btnGuardar.addActionListener(new GuardarActionListener());
			btnGuardar.setToolTipText(Messages.getString("AddParticipante.0")); //$NON-NLS-1$
			btnGuardar.setIcon(new ImageIcon(AddParticipante.class
					.getResource("/recursos/Guardar-32.png"))); //$NON-NLS-1$
			btnGuardar.setFont(new Font("Tahoma", Font.PLAIN, 14)); //$NON-NLS-1$
		}
		{
			btnCancelar = new JButton(Messages.getString("AddParticipante.141")); //$NON-NLS-1$
			btnCancelar.setMnemonic('C');
			btnCancelar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
			btnCancelar.setBounds(453, 540, 142, 40);
			VentanaAnadirParticipante.getContentPane().add(btnCancelar);
			btnCancelar.addActionListener(new CancelarActionListener());
			btnCancelar.setToolTipText(Messages
					.getString("AddParticipante.142")); //$NON-NLS-1$
			btnCancelar.setIcon(new ImageIcon(AddParticipante.class
					.getResource(Messages.getString("AddParticipante.143")))); //$NON-NLS-1$
			btnCancelar.setFont(new Font("Tahoma", Font.PLAIN, 14)); //$NON-NLS-1$
		}
		Util.recuperarIdioma(mntmEspaol, mntmIngls);
	}
	private class WebCamActionListener implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			/*CamaraWeb cw=new CamaraWeb();
			
			cw.VerCamara(lblFoto.getBounds().x, lblFoto.getBounds().y, lblFoto.getBounds().height, lblFoto.getBounds().width);*/
		}
	}
	private class AyudaActionListener implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			JOptionPane.showMessageDialog(VentanaAnadirParticipante,Messages.getString("AddParticipante.60"),Messages.getString("AddCompeticion.10"), JOptionPane.INFORMATION_MESSAGE); //$NON-NLS-1$
		}
	}
	private class MiFocusListener extends FocusAdapter {
		@Override
		public void focusGained(FocusEvent e) {
			e.getComponent().setBackground(new Color(250, 250, 210));
		}

		@Override
		public void focusLost(FocusEvent e) {
			e.getComponent().setBackground(new Color(250, 250, 250));
			if (e.getComponent() == ftfCP) {
				calcularProvincia();
			}
		}
	}

	private class CargarActionListener implements ActionListener {
		public void actionPerformed(ActionEvent arg0) {
			JFileChooser fcAbrir = new JFileChooser();
			fcAbrir.setFileFilter(new ImageFilter());
			int valorDevuelto = fcAbrir
					.showOpenDialog(VentanaAnadirParticipante);
			// Recoger el nombre del fichero seleccionado por el usuario
			if (valorDevuelto == JFileChooser.APPROVE_OPTION) {
				File file = fcAbrir.getSelectedFile();
				// En este punto la aplicaci�n se deber�a encargar de realizar
				// la operaci�n sobre el fichero
				// System.out.println("Fichero seleccionado: " +
				// file.getName());
				lblFoto.setIcon(new ImageIcon(file.getAbsolutePath()));

				btnCargar.setVisible(false);
				btnWebCam.setVisible(false);
				lblOpcion.setVisible(false);

			}
		}
	}

	private class CancelarActionListener implements ActionListener {
		public void actionPerformed(ActionEvent arg0) {
			if (JOptionPane
					.showOptionDialog(
							VentanaAnadirParticipante,
							Messages.getString("AddParticipante.150"), //$NON-NLS-1$
							Messages.getString("AddParticipante.151"), JOptionPane.YES_NO_OPTION, //$NON-NLS-1$
							JOptionPane.QUESTION_MESSAGE, null, null, null) == 0) {
				VentanaAnadirParticipante.setVisible(false);
				ventanaInvocadora.setExtendedState(JFrame.NORMAL);
				ventanaInvocadora.setVisible(true);
				ventanaInvocadora.enable(true);
			}
		}
	}

	private class GuardarActionListener implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			JOptionPane
					.showMessageDialog(
							VentanaAnadirParticipante,
							Messages.getString("AddParticipante.153"), //$NON-NLS-1$
							Messages.getString("AddParticipante.154"), JOptionPane.INFORMATION_MESSAGE); //$NON-NLS-1$
			VentanaAnadirParticipante.setVisible(false);
			ventanaInvocadora.setExtendedState(JFrame.NORMAL);
			ventanaInvocadora.setVisible(true);
			ventanaInvocadora.enable(true);
		}
	}

	private void calcularProvincia() {
		int cp = Integer.parseInt(ftfCP.getText()) / 1000;
		cbProvincia.setSelectedIndex(cp - 1);
	}
	
	void modificar(String n){
		String[] na=n.split(" ");
		tfNombre.setText(na[0]);
		tfApellido1.setText(na[1]);
		tfApellido2.setText(na[2]);
		tfCorreoElectronico.setText("prueba@gmail.com");
		tfNacionalidad.setText("Española");
		tfCalle.setText("Prueba");
		tfN.setText("5");
		tfPuerta.setText("A");
		tfPiso.setText("2");
		tfEscalera.setText("-");
		tfLetra.setText("A");
		tfLocalidad.setText("Ciudad Real");
		tfClubDeportivo.setText("Corona");
		ftfDocumento.setText("05715845-H");
		ftfCP.setText("01005");
		Date d=new Date();
		d.setMonth(5);
		d.setDate(8);
		ftfTelefono.setText("034684597258");
		fechaNacim.setDate(d);
	}

}
